package com.tnl.app.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.tnl.app.entity.Channel;
import com.tnl.base.BaseDAO;


@Repository
public class AdChannelDAO {
	private static final String SQL_GET_ID = "select * from tb_adchannel  where id = ?";
	private static final String SQL_GET_TYPE_CONTENT = "SELECT * from tb_adchannel where 1=1 order by id asc";
	private static final String SQL_GET_ALL = "select * from tb_adchannel ";
	
	
	public List<Channel> getALL() {

		return BaseDAO.queryForList(Channel.class, SQL_GET_ALL);

	}
	
	public Channel getById(int Id) {
		return  BaseDAO.queryForObject(Channel.class, SQL_GET_ID, Id);
	}
	
	public List<Channel> getByContent(){
		return  BaseDAO.queryForList(Channel.class, SQL_GET_TYPE_CONTENT);
	}
	
}
